package com.zzyl.controller.customer;

import com.zzyl.base.PageResponse;
import com.zzyl.base.ResponseResult;
import com.zzyl.controller.BaseController;
import com.zzyl.service.NursingService;
import com.zzyl.vo.NursingProjectVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * @Description CustomerOrderController
 * @Author liangDong
 * @Date 2025-05-16  11:39
 */
@RestController
@RequestMapping("/customer/orders")
public class CustomerOrderController extends BaseController {
    @Autowired
    private NursingService nursingService;

    @GetMapping("/project/page")
    public ResponseResult page(
            @RequestParam(value = "name", required = false) String name,
            @RequestParam(value = "status",required = false) Integer status,
            @RequestParam(value = "pageNum",defaultValue = "1") Integer pageNum,
            @RequestParam(value = "pageSize",defaultValue = "10") Integer pageSize
    ){
        PageResponse<NursingProjectVo> projectList =  nursingService.page(name,status,pageNum,pageSize);
        return success(projectList);
    }

    @GetMapping("/project/{id}")
    public ResponseResult getById(@PathVariable Integer id){
       NursingProjectVo projectVo = nursingService.getById(Long.valueOf(id));
        return success(projectVo);
    }
}
